package com.mark.mall.admin.platform.dto;

import cn.hutool.core.util.ObjectUtil;
import com.mark.mall.admin.platform.entity.Provider;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils;

/**
 * Created by admin on 2021/3/1 21:54
 */
@Data
@ApiModel("物料新增-下拉供应商")
@NoArgsConstructor
public class ProviderSelectDTO {
    @ApiModelProperty(value = "供应商id")
    private String id;

    @ApiModelProperty(value = "供应商编码")
    private String procode;

    @ApiModelProperty(value = "供应商名称")
    private String proname;

    public ProviderSelectDTO(Provider provider) {
        this.id = provider.getId();
        this.procode = !StringUtils.isEmpty(provider.getProcode()) ? provider.getProcode() : "";
        this.proname = !StringUtils.isEmpty(provider.getProname()) ? provider.getProname() : "";
    }
}
